from pydantic import BaseModel, Field
from typing import List, Optional

class BaseAnswer(BaseModel):
    question: Optional[str] = Field("")
    answer: Optional[str] = Field("")
    add_id: Optional[int] = Field(0)

class AnswerCreate(BaseAnswer):
    ...

class AnswerUpdate(BaseAnswer):
    id: int
    def update_dict(self):
        return self.model_dump(exclude_unset=True, exclude={"id"})